package com.excel.validators.excel.entrance;

import java.io.File;
import java.io.InputStream;

import com.excel.validators.core.decorative.inner.ExportEntry;
import com.excel.validators.core.decorative.inner.ExportHandler;
import com.excel.validators.core.decorative.inner.ImportEntry;
import com.excel.validators.core.decorative.inner.ImportHandler;
import com.excel.validators.excel.ExcelInnerHandler;

public class ExcelHandler implements ImportHandler,ExportHandler {

		private final String default_namespace = "default";
	
		@Override
		public ImportEntry importExcel(File newfile) {
				return importExcel(default_namespace, newfile, 0);
		}
	
		@Override
		public ImportEntry importExcel(InputStream instream) {
				return importExcel(default_namespace, instream);
		}
	
		@Override
		public ImportEntry importExcel(String namespace, File newfile, int worksheet) {
				ExcelInnerHandler handler = new ExcelInnerHandler(newfile, worksheet);
				handler.setNamespace(namespace);
				return handler;
		}
	
		@Override
		public ImportEntry importExcel(String namespace, InputStream instream) {
				ExcelInnerHandler handler = new ExcelInnerHandler(instream);
				handler.setNamespace(namespace);
				return handler;
		}

		@Override
		public ExportEntry exportExcel() {
				ExcelInnerHandler handler = new ExcelInnerHandler();
				handler.setNamespace(default_namespace);
				return handler;
		}
		
		@Override
		public ExportEntry exportExcel(String namespace) {
				ExcelInnerHandler handler = new ExcelInnerHandler();
				handler.setNamespace(namespace);
				return handler;
		}
}
